import { io } from 'socket.io-client'

const socket = io('http://127.0.0.1:5000', { autoConnect: true })

socket.on('connect', () => {
   console.log('connected to server')
   socket.emit('message', '段祺瑞')

   console.log(socket.id) // ojIckSD2jqNzOqIrAGzL
})

socket.on('show', function (info) {
   console.log('开始交谈', info)
})

socket.on('disconnected', function () {
   console.log('disconnected with server')
})

export { socket }
